package com.freewater.springboot.demo.aop.instmode;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Scope;

@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class AppConfig {

    @Bean
    public SomeBusinessImpl1 someBusiness1() {
        return new SomeBusinessImpl1();
    }

    @Bean
    public SomeBusinessImpl2 someBusiness2() {
        return new SomeBusinessImpl2();
    }

    @Bean
    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    public Aspect1 aspect1() {
        return new Aspect1();
    }
}
